<div id="list_table">
<?php echo $link; ?>
<table width="980px" cellpadding="2" cellspacing="2">
<tbody>
    <tr>
        <td width="50px" class="table_title first">Userid</td>
        <td width="200px" class="table_title">Username</td>
        <td width="200px" class="table_title">Email</td>
        <td width="200px" class="table_title">Ngày đăng ký</td>
        <td width="110px" class="table_title">Chức danh</td>
        <td width="110px" class="table_title">Status</td>
        <td width="110px" class="table_title">Modify</td>
    </tr>
    <?php
    $count=0;
    if(count($users)>0){
        foreach ($users as $item) {
            $count++;
            $chucdanh = 'Thành viên';
            if($item['level'] == 2)
                $chucdanh = 'Quản trị viên';
            if($count%2==0)
                echo "<tr class='row_even'>";
            else
                echo "<tr class='row_odd'>";
            echo '<td style="text-align:center;text-indent:0">'.$item['userid'].'</td>';
            echo '<td>'.$item['username'].'</td>';
            echo '<td>'.$item['email'].'</td>';
            echo '<td>'.$item['adddate'].'</td>';
            echo '<td>'.$chucdanh.'</td>';
            if($item['active']==1){
                echo '<td>Actived</td>';
            }else{
                echo '<td>Pending...</td>';
            }
            echo '<td class="alt">
                <a href="'.base_url().'backend/user/edituser/'.$item['userid'].'">Edit</a>
                <a href="'.base_url().'backend/user/deluser/'.$item['userid'].'" >Delete</a>
            </td>';
            echo "</tr>";  
        }
    }else{echo 'không có dữ liệu user';}
    ?>
</tbody>
</table>
</div>